<?php
class Membership_login_model extends CI_Model {
    function __construct()
    {
        parent::__construct();
    }
    
    function get_last_login($data)
    {
    	$this->db->where('idmember', $data['idmember']);
    	$this->db->order_by('date', 'desc'); 
    	return $this->db->get('membership_login')->row();
    }
    
    function insert($data)
    {
    	$this->db->set('date', 'NOW()', false);
		return $this->db->insert('membership_login', $data);
    }
}
?>